import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'home',
            component: () => import('@/views/Home.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('@/views/Register.vue')
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/views/Login.vue')
        },
        {
            path: '/setUp',
            name: 'setUp',
            component: () => import('@/views/UserSetup.vue')
        },
        {
            path: '/book_rank',
            name: 'bookRank',
            component: () => import('@/views/BookRank.vue')
        },
        {
            path: '/book_class',
            name: 'book_class',
            component: () => import('@/views/BookClass.vue')
        },
        {
            path: '/book/:id',
            name: 'book',
            component: () => import('@/views/Book.vue')

        },
        {
            path: '/chapter_list/:bookId',
            name: 'chapterList',
            component: () => import('@/views/ChapterList.vue')

        },
        {
            path: '/book/:id/:chapterId',
            name: 'bookContent',
            component: () => import('@/views/BookContent.vue')

        },
        {
            path: '/user/setup',
            name: 'userSetup',
            component: () => import('@/views/UserSetup.vue')
        },
        {
            path: '/user/comment',
            name: 'userComment',
            component: () => import('@/views/UserComment.vue')

        },
        {
            path: '/author/register',
            name: 'authorRegister',
            component: () => import('@/views/author/Register.vue')
        },
        {
            path: '/author/book_list',
            name: 'authorBookList',
            component: () => import('@/views/author/BookList.vue')
        },
        {
            path: '/author/book_add',
            name: 'authorBookAdd',
            component: () => import('@/views/author/BookAdd.vue')
        },
        {
            path: '/author/chapter_list',
            name: 'authorChapterList',
            component: () => import('@/views/author/ChapterList.vue')
        },
        {
            path: '/author/chapter_add',
            name: 'authorChapterAdd',
            component: () => import('@/views/author/ChapterAdd.vue')
        },
        {
            path: '/author/chapter_update',
            name: 'authorChapterUpdate',
            component: () => import('@/views/author/ChapterUpdate.vue')
        },
        {
            path: '/test',
            name: 'test',
            component: () => import('@/views/Test.vue')

        },
    ]
})

export default router
